package my;

import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service
public class MyService {
    @Resource
    private JdbcTemplate jdbcTemplate;
    public void hello(Object vo) {
        System.out.println("rpc调用 耗时操作" + vo);
        doHello();
    }
    @Transactional
    private final void doHello() {
        int updated = jdbcTemplate.update("update users set name='李四3' where id=1");
        System.out.println("更新了" + updated + "行");
        throw new RuntimeException("模拟业务异常");
    }
}
